
*Data
* 007_lead-emissions_exh-1.csv
* fig_2.dta
* uscoord_albers3.dta
* ToxicTruthAirborneLeadData.dta
* completed_fertility.dta
* ToxicTruthSoil.dta
* figA3-1.dta
* fig_A3-4.dta
* airlead_longrun_trends.dta
* fertility_longrun_trends.dta
* TA4-6.dta
* ToxicTruthCZone.dta



*************
*Figures
************************

************************
*Figure 1 – Anthropogenic Lead Emissions in the U.S. by Source Category, 1970-2011


import delimited 007_lead-emissions_exh-1.csv, clear 

gen tot= othersources+ nonroadengines +fuelcombustion+ metalsindustrialprocessing +onroadvehicles
gen other= othersources/tot
gen nonroad=nonroadengines/tot
gen fuel_combustion=fuelcombustion/tot
gen metals=metalsindustrialprocessing/tot
gen onroad_vehicles=onroadvehicles/tot

label variable onroad_vehicles "On-road vehicles"
label variable metals "Metals industrial processing"
label variable fuel_combustion "Fuel combustion"
label variable nonroad "Nonroad engines"
label variable other "Other sources"


set scheme s2mono
line onroad_vehicles nonroad metals fuel_combustion other year, ///
ytitle("Share of Total Lead Emissions") ///
ylabel(, ang(0)) 
graph export "F1.pdf"
************************



************************
* Figure 2 – Counties in Our Airborne Lead Sample
************************
 *data: fig_2.dta
 *data: uscoord_albers3.dta
 
use "fig_2.dta", clear
spmap all_county using cb_2017_us_county_500k/uscoord_albers3 if STATEFP!=15 & STATEFP!=2 & STATEFP<57,  clmethod(unique)  id(id) ///			
fcolor(white black*0.4 black ) ///
legend(size(3) symxsize(*2) col(1) position(8) ///
title("Airborne Lead Sample", size(3))) ///
plotregion(margin(0 0 0 0)) 
graph export "fig2.pdf"
************************


* Figure 3 – Airborne Lead and General Fertility Rate: Counties With and Without Recommended Highway, Before and After Policy Changes 
use ToxicTruthAirborneLeadData.dta, clear

gen q=.
replace q=1 if month==1 | month==2 | month==3
replace q=2 if month==4 | month==5 | month==6
replace q=3 if month==7 | month==8 | month==9
replace q=4 if month==10 | month==11 | month==12

egen lead_wi = wtmean(lead), weight(POPF)  by(month year inst1944)
egen F9BR_POPF_wi = wtmean(F9BR_POPF), weight(POPF)  by(month year inst1944)


foreach var in F9BR_POPF_wi lead_wi {
capture drop av_qy_`var'0
capture drop av_qy_`var'1
by q year, sort:  egen av_qy_`var'0=mean(`var') if inst1944==0
by q year, sort:  egen av_qy_`var'1=mean(`var') if inst1944==1
}

gen qy=yq(year, q)
format qy %tq

label variable qy "Time"

* Panel A. Airborne Lead
set scheme s2mono
sort qy
line av_qy_lead_wi1 av_qy_lead_wi0 qy, tline(1979q4 1985q3) legend(order(2 "HWPlan1944=0"1 "HWPlan1944=1" ))  ///
plotregion(fcolor(white)) graphregion(fcolor(gs15)) ///
text(1 82 "Oct 1979")  ///
text(0.95 82 " ≤0.8 gpg") ///
text(1 105 "Jul 1985") ///
text(0.95 105 " ≤0.5 gplg") ///
ylabel(0 (0.3) 1.2) ///
ytitle("Airborne Lead, µg/m3 ") 
graph export "F4PanelA.pdf"

* Panel B. General Fertility Rates
set scheme s2mono
sort qy
line av_qy_F9BR_POPF_wi1 av_qy_F9BR_POPF_wi0 qy, tline(1979q4 1985q3) legend(order(2 "HWPlan1944=0"1 "HWPlan1944=1" ))  ///
plotregion(fcolor(white)) graphregion(fcolor(gs15)) ///
text(6.45 82.5 "Oct 1979")  ///
text(6.35 82.5 " ≤0.8 gpg") ///
text(6.45 105.5  "Jul 1985") ///
text(6.35 105.5 " ≤0.5 gplg") ///
ylabel(5 (0.5) 6.5) ///
ytitle("Fertility Rate per 1,000 Women")
graph export "F4PanelB.pdf" 
************************

************************
* Figure 4 – Counterfactual Analysis: Keeping Airborne Lead at the 1978 Level
*Run the main regression
use ToxicTruthAirborneLeadData.dta, clear

local replace="replace"
foreach weight in "[aweight=POPF]"{
foreach var in F9BR_POPF{
foreach lead in lead{
foreach inst in  ///
"after1inst1944 after2inst1944 AFTER1 AFTER2" ///
{
foreach fe in ///
     "i.county_fips i.year i.month i.state_fips##i.year" ///
{	 
foreach c1 in ///
		"lnemp lnpci t t2 p p2 i.year#c.latitude i.year#c.longitude mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789" ///
{	
ivreg2 `var' (`lead' =`inst') `fe' `c1' ///
`weight', cluster(county_fips) 

}
}
}
}
}
}

predict F_pr, xb
gen Ftrue=F_pr

sum	lead if	year==1978	[aweight=POPF]

gen DIFw= -.45032*(lead-.845563)
gen DIFw_ub= (-.45032+1.96*0.207)*(lead-.845563)
gen DIFw_lb= (-.45032-1.96*0.207)*(lead-.845563)

gen Fwhatifw=Ftrue-DIFw
 
 foreach var in Ftrue Fwhatifw DIFw DIFw_ub DIFw_lb{
 capture drop `var'_w
 egen `var'_w = wtmean(`var'), weight(wF9BR_POPF)  by(month year)
 }
 
foreach var in Ftrue Fwhatifw DIFw DIFw_ub DIFw_lb{
capture drop av_y_`var'_w
by year, sort: egen av_y_`var'_w=mean(`var'_w)

} 
	
label variable av_y_Fwhatifw_w "Predicted Fertility Rate if Lead as in 1978 "
label variable av_y_Ftrue_w "Observed Fertility Rate"
label variable av_y_DIFw_w "Observed Fertility Rate"
  
**Births
  
by year, sort: egen tot_y_POPF=total(POPF)
capture drop tot_B_y_pr
*in 1,000
gen tot_B_y_pr=(av_y_Ftrue_w*tot_y_POPF/1000)/1000
label variable tot_B_y_pr "Observed #Births"

capture drop tot_B1_y_pr
*in 1,000
gen tot_B1_y_pr=(av_y_Fwhatifw_w*tot_y_POPF/1000)/1000
label variable tot_B1_y_pr "Predicted #Births, if Lead as in 1978"

*DIF
foreach var in av_y_DIFw_lb_w av_y_DIFw_ub_w av_y_DIFw_w{
capture drop tot_`var'
gen tot_`var'=(`var'*tot_y_POPF/1000)/1000
}

capture drop diff_totB
gen diff_totB=1000*(tot_B_y_pr-tot_B1_y_pr)
label variable diff_totB "Observed #Births - Predicted #Births"
	 
foreach var in tot_B_y_pr tot_B1_y_pr diff_totB{
format `var' %12.2gc
}


label variable year "Time"	

 
set scheme s2mono
line av_y_Ftrue_w  av_y_Fwhatifw_w  year if year<=1987, ylabel(, angle(0)) title("Fertility Rate, per 1,000 Women ") legend(cols(1) ) 
graph export "F4a.pdf"
line av_y_DIFw_lb_w av_y_DIFw_ub_w av_y_DIFw_w year if year<=1987, ylabel(, angle(0)) legend(off)  ytitle(" ")  title("Observed Fertility Rate - Predicted Fertility Rate" ) 
graph export "F4b.pdf"
line tot_B_y_pr tot_B1_y_pr year if year<=1987, ylabel(, angle(0)) title("Number of Births, in Thousands") legend(cols(1) ) 
graph export "F4c.pdf"
line tot_av_y_DIFw_lb_w tot_av_y_DIFw_ub_w tot_av_y_DIFw_w year if year<=1987, ylabel(, angle(0)) legend(off)  ytitle(" ")  title("Observed #Births - Predicted #Births") 
graph export "F4d.pdf"
************************
	 
	 
************************
	 *TABLES
************************ 
use ToxicTruthAirborneLeadData.dta, clear
	 
*Table 1 – Airborne Lead and General Fertility Rate: 1978-1988	 


* Panel A. 1st Stage - Airborne Lead on Instruments 

local replace="replace"
foreach weight in "[aweight=POPF]"{
foreach var in lead{
foreach inst in ///
"after1inst1944 after2inst1944 AFTER1 AFTER2"{
foreach fe in ///	
	"i.county_fips" ///
	"i.county_fips i.year i.month i.state_fips##i.year" ///
{
foreach c1 in ///
	" "{
ivreg2 `var' `inst' `fe' `c1' ///
`weight' , cluster(county_fips) 
outreg2 `inst' using Table1_PanelA.xls, se bdec(3) sdec(3) rdec(3) excel `replace'
local replace=" "
}
}

foreach fe in ///
	"i.county_fips i.year i.month i.state_fips##i.year" ///
	{
foreach c1 in ///
		"lnemp lnpci" ///
		"lnemp lnpci t t2 p p2 i.year#c.latitude i.year#c.longitude" ///
		"lnemp lnpci t t2 p p2 i.year#c.latitude i.year#c.longitude mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789" ///
{	
ivreg2 `var' `inst' `fe' `c1' ///
`weight' , cluster(county_fips) 
outreg2 `inst' using Table1_PanelA.xls, se bdec(3) sdec(3) rdec(3) excel `replace'
local replace=" "
}
}
}
}
}



*Panel B. OLS

local replace="replace"
foreach weight in "[aweight=POPF]"{
foreach var in F9BR_POPF{
foreach lead in lead{
foreach fe in ///	
	"i.county_fips" ///
	"i.county_fips i.year i.month i.state_fips##i.year" ///
{
foreach c1 in ///
	" "{
reg `var' `lead' `fe' `c1' ///
`weight',  cluster(county_fips) 
outreg2 `lead' using Table1_PanelB.xls,se bdec(3) sdec(3) rdec(3) excel `replace'
local replace=" "
}
}

foreach fe in ///
	"i.county_fips i.year i.month i.state_fips##i.year" ///
{
foreach c1 in ///
		"lnemp lnpci" ///
		"lnemp lnpci t t2 p p2 i.year#c.latitude i.year#c.longitude" ///
		"lnemp lnpci t t2 p p2 i.year#c.latitude i.year#c.longitude mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789" ///
{	
reg `var' `lead' `fe' `c1' ///
`weight',cluster(county_fips) 
outreg2 `lead' using Table1_PanelB.xls,se bdec(3) sdec(3) rdec(3) excel `replace'
local replace=" "
}
}
}
}
}


*Panel C. IV

local replace="replace"
foreach weight in "[aweight=POPF]"{
foreach var in F9BR_POPF{
foreach lead in lead{
foreach inst in  ///
"after1inst1944 after2inst1944 AFTER1 AFTER2" ///
{
foreach fe in ///	
	"i.county_fips" ///
	"i.county_fips i.year i.month i.state_fips##i.year" ///
{
foreach c1 in ///
	" "{
ivreg2 `var' (`lead' =`inst') `fe' `c1' ///
`weight',  partial(`fe') cluster(county_fips) 
outreg2 `lead' using Table1_PanelC.xls, ///
addstat("Kleibergen-Paap rk Wald F", e(widstat)) ///
se bdec(3) sdec(3) rdec(3) excel `replace'
local replace=" "
}
}

foreach fe in ///
	"i.county_fips i.year i.month i.state_fips##i.year" ///
{
foreach c1 in ///
		"lnemp lnpci" ///
		"lnemp lnpci t t2 p p2 i.year#c.latitude i.year#c.longitude" ///
		"lnemp lnpci t t2 p p2 i.year#c.latitude i.year#c.longitude mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789" ///
{	
ivreg2 `var' (`lead' =`inst') `fe' `c1' ///
`weight',  partial(`fe') cluster(county_fips) 
outreg2 `lead' using Table1_PanelC.xls, ///
addstat("Kleibergen-Paap rk Wald F", e(widstat)) ///
se bdec(3) sdec(3) rdec(3) excel `replace'
local replace=" "
}
}
}
}
}
}


**************************
*Table 2 – Airborne Lead and Age Specific Birth Rates
**************************
use ToxicTruthAirborneLeadData.dta, clear


foreach var in a1519 a2024 a2529 a3034 a3539 a4044{
gen wF9R_`var'=p_`var'_rall
}

local replace="replace"
foreach lead in lead{
foreach var in F9R_a1519 F9R_a2024 F9R_a2529 F9R_a3034 F9R_a3539 F9R_a4044{
foreach weight in "[aweight=w`var']"{
foreach inst in "after1inst1944 after2inst1944 AFTER1 AFTER2"{
foreach fe in ///
     "i.county_fips i.year i.month i.state_fips##i.year" ///
{
foreach c1 in ///
		"lnemp lnpci t t2 p p2 i.year#c.latitude i.year#c.longitude mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789" ///
{	
ivreg2 `var' (`lead' =`inst') `fe' `c1' ///
`weight',  partial(`fe') cluster(county_fips) 
outreg2 `lead' using Table2.xls, ///
addstat("Kleibergen-Paap rk Wald F", e(widstat)) ///
se bdec(3) sdec(3) rdec(3) excel `replace'
local replace=" "
}
}
}
}
}
}

**************************



***************************
*Table 3 – Airborne Lead and Completed Fertility: 1980-1990 
***************************


use completed_fertility.dta, clear 


areg cheborn i.year#i.state_fips i.year#c.lat i.year#c.lon /*
*/ ytav ytav2 yddb10 yddb102 ydda29 ydda292 yprcp yprcp2 /*
*/ ib6.educ i.race i.hispan i.marst i.age hhincome99 hhincome992 sei poverty /*
*/ arithmean if county_panel==1 [aw=perwt], /*
*/ absorb(county_fips) cluster(county_fips)
outreg2 arithmean using Table3.xls, se bdec(3) rdec(3) /*
*/ ctitle(aOLSMoHH) excel replace


areg arithmean i.year#i.state_fips i.year#c.lat i.year#c.lon /*
*/ ytav ytav2 yddb10 yddb102 ydda29 ydda292 yprcp yprcp2 /*
*/ ib6.educ i.race i.hispan i.marst i.age hhincome99 hhincome992 sei poverty /*
*/ inst19441990 if county_panel==1 [aw=perwt], /*
*/ absorb(county_fips) cluster(county_fips)
outreg2 inst19441990 using Table3.xls, se bdec(3) rdec(3) /*
*/ ctitle(a1stMoHH) excel append 


ivreg2 cheborn i.county_fips i.year#i.state_fips i.year#c.lat i.year#c.lon /*
*/ ytav ytav2 yddb10 yddb102 ydda29 ydda292 yprcp yprcp2 /*
*/ ib6.educ i.race i.hispan i.marst i.age hhincome99 hhincome992 sei poverty /*
*/ (arithmean = inst19441990) if county_panel==1 [aw=perwt], /*
*/ partial(i.county_fips i.year#i.state_fips i.year#c.lat i.year#c.lon /*
*/ ytav ytav2 yddb10 yddb102 ydda29 ydda292 yprcp yprcp2 /*
*/ ib6.educ i.race i.hispan i.marst i.age hhincome99 hhincome992 sei poverty) cluster(county_fips)
outreg2 arithmean using Table3.xls, se bdec(3) rdec(3) /*
*/ addstat("Underidentification_stat",e(idstat),"p_value", e(idp), /*
*/ "WeakIdentificationStat", e(widstat)) ctitle(aIVMoHH) excel append 




areg cheborn i.year#i.state_fips i.year#c.lat i.year#c.lon /*
*/ ytav ytav2 yddb10 yddb102 ydda29 ydda292 yprcp yprcp2 /*
*/ ib6.educ i.race i.hispan i.marst i.age hhincome99 hhincome992 sei poverty /*
*/ arithmean [aw=perwt] if (migrate5d==10 |migrate5d==21) & state_fips==bpl & county_panel==1, /*
*/ absorb(county_fips) cluster(county_fips)
outreg2 arithmean using Table3.xls, se bdec(3) rdec(3) /*
*/ ctitle(OLSMoHH) excel append


areg arithmean i.year#i.state_fips i.year#c.lat i.year#c.lon /*
*/ ytav ytav2 yddb10 yddb102 ydda29 ydda292 yprcp yprcp2 /*
*/ ib6.educ i.race i.hispan i.marst i.age hhincome99 hhincome992 sei poverty /*
*/ inst19441990 [aw=perwt] if (migrate5d==10 |migrate5d==21) & state_fips==bpl & county_panel==1, /*
*/ absorb(county_fips) cluster(county_fips)
outreg2 inst19441990 using Table3.xls, se bdec(3) rdec(3) /*
*/ ctitle(1stMoHH) excel append 


ivreg2 cheborn i.county_fips i.year#i.state_fips i.year#c.lat i.year#c.lon /*
*/ ytav ytav2 yddb10 yddb102 ydda29 ydda292 yprcp yprcp2 /*
*/ ib6.educ i.race i.hispan i.marst i.age hhincome99 hhincome992 sei poverty /*
*/ (arithmean = inst19441990) [aw=perwt] if (migrate5d==10 |migrate5d==21) & state_fips==bpl & county_panel==1, /*
*/ partial(i.county_fips i.year#i.state_fips i.year#c.lat i.year#c.lon /*
*/ ytav ytav2 yddb10 yddb102 ydda29 ydda292 yprcp yprcp2 /*
*/ ib6.educ i.race i.hispan i.marst i.age hhincome99 hhincome992 sei poverty) cluster(county_fips)
outreg2 arithmean using Table3.xls, se bdec(3) rdec(3) /*
*/ addstat("Underidentification_stat",e(idstat),"p_value", e(idp), /*
*/ "WeakIdentificationStat", e(widstat)) ctitle(IVMoHH) excel append 




areg cheborn i.year#i.state_fips i.year#c.lat i.year#c.lon /*
*/ ytav ytav2 yddb10 yddb102 ydda29 ydda292 yprcp yprcp2 /*
*/ ib6.educ i.race i.hispan i.marst i.age hhincome99 hhincome992 sei poverty /*
*/ arithmean [aw=perwt], /*
*/ absorb(county_fips) cluster(county_fips)
outreg2 arithmean using Table3.xls, se bdec(3) rdec(3) /*
*/ ctitle(aOLSMoHH) excel append


areg arithmean i.year#i.state_fips i.year#c.lat i.year#c.lon /*
*/ ytav ytav2 yddb10 yddb102 ydda29 ydda292 yprcp yprcp2 /*
*/ ib6.educ i.race i.hispan i.marst i.age hhincome99 hhincome992 sei poverty /*
*/ inst19441990 [aw=perwt], /*
*/ absorb(county_fips) cluster(county_fips)
outreg2 inst19441990 using Table3.xls, se bdec(3) rdec(3) /*
*/ ctitle(a1stMoHH) excel append 

ivreg2 cheborn i.county_fips i.year#i.state_fips i.year#c.lat i.year#c.lon /*
*/ ytav ytav2 yddb10 yddb102 ydda29 ydda292 yprcp yprcp2 /*
*/ ib6.educ i.race i.hispan i.marst i.age hhincome99 hhincome992 sei poverty /*
*/ (arithmean = inst19441990) [aw=perwt], /*
*/ partial(i.county_fips i.year#i.state_fips i.year#c.lat i.year#c.lon /*
*/ ytav ytav2 yddb10 yddb102 ydda29 ydda292 yprcp yprcp2 /*
*/ ib6.educ i.race i.hispan i.marst i.age hhincome99 hhincome992 sei poverty) cluster(county_fips)
outreg2 arithmean using Table3.xls, se bdec(3) rdec(3) /*
*/ addstat("Underidentification_stat",e(idstat),"p_value", e(idp), /*
*/ "WeakIdentificationStat", e(widstat)) ctitle(aIVMoHH) excel append 



areg cheborn i.year#i.state_fips i.year#c.lat i.year#c.lon /*
*/ ytav ytav2 yddb10 yddb102 ydda29 ydda292 yprcp yprcp2 /*
*/ ib6.educ i.race i.hispan i.marst i.age hhincome99 hhincome992 sei poverty /*
*/ arithmean [aw=perwt] if (migrate5d==10 |migrate5d==21) & state_fips==bpl, /*
*/ absorb(county_fips) cluster(county_fips)
outreg2 arithmean using Table3.xls, se bdec(3) rdec(3) /*
*/ ctitle(OLSMoHH) excel append

areg arithmean i.year#i.state_fips i.year#c.lat i.year#c.lon /*
*/ ytav ytav2 yddb10 yddb102 ydda29 ydda292 yprcp yprcp2 /*
*/ ib6.educ i.race i.hispan i.marst i.age hhincome99 hhincome992 sei poverty /*
*/ inst19441990 [aw=perwt] if (migrate5d==10 |migrate5d==21) & state_fips==bpl, /*
*/ absorb(county_fips) cluster(county_fips)
outreg2 inst19441990 using Table3.xls, se bdec(3) rdec(3) /*
*/ ctitle(1stMoHH) excel append 

ivreg2 cheborn i.county_fips i.year#i.state_fips i.year#c.lat i.year#c.lon /*
*/ ytav ytav2 yddb10 yddb102 ydda29 ydda292 yprcp yprcp2 /*
*/ ib6.educ i.race i.hispan i.marst i.age hhincome99 hhincome992 sei poverty /*
*/ (arithmean = inst19441990) [aw=perwt] if (migrate5d==10 |migrate5d==21) & state_fips==bpl, /*
*/ partial(i.county_fips i.year#i.state_fips i.year#c.lat i.year#c.lon /*
*/ ytav ytav2 yddb10 yddb102 ydda29 ydda292 yprcp yprcp2 /*
*/ ib6.educ i.race i.hispan i.marst i.age hhincome99 hhincome992 sei poverty) cluster(county_fips)
outreg2 arithmean using Table3.xls, se bdec(3) rdec(3) /*
*/ addstat("Underidentification_stat",e(idstat),"p_value", e(idp), /*
*/ "WeakIdentificationStat", e(widstat)) ctitle(IVMoHH) excel append 


***************************	 

*Table 4 – The 2000s Lead in Topsoil and General Fertility Rate 

use ToxicTruthSoil.dta, clear


*First Stage
local replace="replace"
foreach dep in LeadH1{
foreach w in "[aweight= POPF]"{
foreach c1 in ///
"yprcp ytav mydda29 myddb10 i.STATEFIP latitude longitude" ///
"swhite2007 percforeign200509 s25yrshsch200509 s25yrscoll200509 sage5 sage59 sage1014 sage1519 sage2024 sage2529 sage3034 sage3539 sage4044 sage4549 sage5054 sage5559 sage6064 yprcp ytav mydda29 myddb10 i.STATEFIP latitude longitude" ///
"emp1000		pci1000		pctrsfr1000		emp10002		pci10002		pctrsfr10002		unemprate2007		percbelpovrate2007 swhite2007 percforeign200509 s25yrshsch200509 s25yrscoll200509 sage5 sage59 sage1014 sage1519 sage2024 sage2529 sage3034 sage3539 sage4044 sage4549 sage5054 sage5559 sage6064 yprcp ytav mydda29 myddb10 i.STATEFIP latitude longitude" ///
"phousbuilt1939e phousbuilt194049 phousbuilt195059 phousbuilt196069 phousbuilt197079 phousbuilt198089 phousbuilt199099 phousbuilt200004 phousbuilt2005p housbuittotal medhousroom200509 emp1000		pci1000		pctrsfr1000		emp10002		pci10002		pctrsfr10002		unemprate2007		percbelpovrate2007 swhite2007 percforeign200509 s25yrshsch200509 s25yrscoll200509 sage5 sage59 sage1014 sage1519 sage2024 sage2529 sage3034 sage3539 sage4044 sage4549 sage5054 sage5559 sage6064 yprcp ytav mydda29 myddb10 i.STATEFIP latitude longitude" ///
"demvotepres2008 nonattANY phousbuilt1939e phousbuilt194049 phousbuilt195059 phousbuilt196069 phousbuilt197079 phousbuilt198089 phousbuilt199099 phousbuilt200004 phousbuilt2005p housbuittotal medhousroom200509 emp1000		pci1000		pctrsfr1000		emp10002		pci10002		pctrsfr10002		unemprate2007		percbelpovrate2007 swhite2007 percforeign200509 s25yrshsch200509 s25yrscoll200509 sage5 sage59 sage1014 sage1519 sage2024 sage2529 sage3034 sage3539 sage4044 sage4549 sage5054 sage5559 sage6064 yprcp ytav mydda29 myddb10 i.STATEFIP latitude longitude"{
reg `dep' inst1944 `c1' `w',  cluster(STATEFIP)
outreg2 inst1944 `c1'  using Table4_1stStage.xls, se bdec(3) rdec(3) ///
excel `replace' 
local replace=" "

}
}
}


*OLS
local replace="replace"
foreach dep in rBIRTHS_RES{
foreach w in "[aweight= POPF]"{
foreach c1 in ///
"yprcp ytav mydda29 myddb10 i.STATEFIP latitude longitude" ///
"swhite2007 percforeign200509 s25yrshsch200509 s25yrscoll200509 sage5 sage59 sage1014 sage1519 sage2024 sage2529 sage3034 sage3539 sage4044 sage4549 sage5054 sage5559 sage6064 yprcp ytav mydda29 myddb10 i.STATEFIP latitude longitude" ///
"emp1000		pci1000		pctrsfr1000		emp10002		pci10002		pctrsfr10002		unemprate2007		percbelpovrate2007 swhite2007 percforeign200509 s25yrshsch200509 s25yrscoll200509 sage5 sage59 sage1014 sage1519 sage2024 sage2529 sage3034 sage3539 sage4044 sage4549 sage5054 sage5559 sage6064 yprcp ytav mydda29 myddb10 i.STATEFIP latitude longitude" ///
"phousbuilt1939e phousbuilt194049 phousbuilt195059 phousbuilt196069 phousbuilt197079 phousbuilt198089 phousbuilt199099 phousbuilt200004 phousbuilt2005p housbuittotal medhousroom200509 emp1000		pci1000		pctrsfr1000		emp10002		pci10002		pctrsfr10002		unemprate2007		percbelpovrate2007 swhite2007 percforeign200509 s25yrshsch200509 s25yrscoll200509 sage5 sage59 sage1014 sage1519 sage2024 sage2529 sage3034 sage3539 sage4044 sage4549 sage5054 sage5559 sage6064 yprcp ytav mydda29 myddb10 i.STATEFIP latitude longitude" ///
"demvotepres2008 nonattANY phousbuilt1939e phousbuilt194049 phousbuilt195059 phousbuilt196069 phousbuilt197079 phousbuilt198089 phousbuilt199099 phousbuilt200004 phousbuilt2005p housbuittotal medhousroom200509 emp1000		pci1000		pctrsfr1000		emp10002		pci10002		pctrsfr10002		unemprate2007		percbelpovrate2007 swhite2007 percforeign200509 s25yrshsch200509 s25yrscoll200509 sage5 sage59 sage1014 sage1519 sage2024 sage2529 sage3034 sage3539 sage4044 sage4549 sage5054 sage5559 sage6064 yprcp ytav mydda29 myddb10 i.STATEFIP latitude longitude"{
reg `dep' LeadH1 `c1' `w', cluster(STATEFIP)
outreg2 LeadH1 `c1'  using Table4_OLS.xls, se bdec(3) rdec(3) ///
excel `replace' 
local replace=" "

}
}
}


*IV
local replace="replace"
foreach dep in rBIRTHS_RES{
foreach w in "[aweight= POPF]"{
foreach lead in LeadH1 {
foreach c1 in ///
"yprcp ytav mydda29 myddb10 i.STATEFIP latitude longitude" ///
"swhite2007 percforeign200509 s25yrshsch200509 s25yrscoll200509 sage5 sage59 sage1014 sage1519 sage2024 sage2529 sage3034 sage3539 sage4044 sage4549 sage5054 sage5559 sage6064 yprcp ytav mydda29 myddb10 i.STATEFIP latitude longitude" ///
"emp1000		pci1000		pctrsfr1000		emp10002		pci10002		pctrsfr10002		unemprate2007		percbelpovrate2007 swhite2007 percforeign200509 s25yrshsch200509 s25yrscoll200509 sage5 sage59 sage1014 sage1519 sage2024 sage2529 sage3034 sage3539 sage4044 sage4549 sage5054 sage5559 sage6064 yprcp ytav mydda29 myddb10 i.STATEFIP latitude longitude" ///
"phousbuilt1939e phousbuilt194049 phousbuilt195059 phousbuilt196069 phousbuilt197079 phousbuilt198089 phousbuilt199099 phousbuilt200004 phousbuilt2005p housbuittotal medhousroom200509 emp1000		pci1000		pctrsfr1000		emp10002		pci10002		pctrsfr10002		unemprate2007		percbelpovrate2007 swhite2007 percforeign200509 s25yrshsch200509 s25yrscoll200509 sage5 sage59 sage1014 sage1519 sage2024 sage2529 sage3034 sage3539 sage4044 sage4549 sage5054 sage5559 sage6064 yprcp ytav mydda29 myddb10 i.STATEFIP latitude longitude" ///
"demvotepres2008 nonattANY phousbuilt1939e phousbuilt194049 phousbuilt195059 phousbuilt196069 phousbuilt197079 phousbuilt198089 phousbuilt199099 phousbuilt200004 phousbuilt2005p housbuittotal medhousroom200509 emp1000		pci1000		pctrsfr1000		emp10002		pci10002		pctrsfr10002		unemprate2007		percbelpovrate2007 swhite2007 percforeign200509 s25yrshsch200509 s25yrscoll200509 sage5 sage59 sage1014 sage1519 sage2024 sage2529 sage3034 sage3539 sage4044 sage4549 sage5054 sage5559 sage6064 yprcp ytav mydda29 myddb10 i.STATEFIP latitude longitude"{
ivreg2 `dep' (`lead'=inst1944) `c1'  `w', partial(`c1') cluster(STATEFIP)
outreg2 `lead' `c1'  using Table4_IV.xls, se bdec(3) rdec(3) ///
addstat("Kleibergen-Paap rk Wald F", e(widstat)) ///
excel `replace' 
local replace=" "

}
}
}
}



*Appendix Figures and Tables


*Appendix A3. Data Description

*Figure A3.1  - Number of Airborne Lead Monitors Over Time
use figA3-1.dta, clear

line num_mon modate, ///
xtitle("Time") ytitle("Number of Lead Monitors") ///
xlabel(192(24)371) ///
xline(216) xline(338) ///
text(150 276 "Study Period")


* Figure A3.4 – Lead in Topsoil in the 2000s


use "fig_A3-4.dta", clear

*Panel A
spmap leadPCT using uscoord_albers3.dta if STATEFP!=15 & STATEFP!=2 & STATEFP<57,  clmethod(unique)  id(id) ///			
fcolor(black black*0.6 black*0.4 black*0.2 white) ///
legend(size(3) symxsize(*2) col(1) position(8) ///
title("Lead in Topsoil", size(3))) ///
plotregion(margin(0 0 0 0)) 
graph export "fig_A3-3a.pdf"

*Panel B
spmap leadHW using uscoord_albers3.dta if STATEFP!=15 & STATEFP!=2 & STATEFP<57,  clmethod(unique)  id(id) ///			
fcolor(black black*0.6 black*0.4 black*0.2 white) ///
legend(size(3) symxsize(*2) col(1) position(8) ///
title("Lead in Topsoil", size(3))) ///
plotregion(margin(0 0 0 0)) 
graph export "fig_A3-3b.pdf"



*Figure A3.5 – Trends in Annual Airborne Lead Concentration and Annual Fertility Rates for 1972-1998 

use airlead_longrun_trends.dta, clear

twoway (connected arithmean year if inst1944==1, graphregion(color(gs15)) /*
*/ sort mcolor(black) msymbol(circle) lcolor(black) lwidth(medthin) lpattern(solid)) /*
*/ (connected arithmean year if inst1944==0, graphregion(color(gs15)) /*
*/ sort mcolor(black) msymbol(circle_hollow) lcolor(black) lwidth(medthin) lpattern(dash)), /*
*/ ytitle(Airborne Lead (µg/m3)) ylabel(0(0.15)2.1, angle(0) grid glcolor(gs15)) /*
*/ xtitle("") xlabel(1972(2)1998, angle(45)) /*
*/ xline(1978 1988, lwidth(thin) lpattern(shortdash) lcolor(black)) /*
*/ text(1 1980 "Period of Study", place(e) box fcolor(gs15) just(center)) /* 
*/ legend(on order(1 "HWPlan1944=1" 2 "HWPlan1944=0")) 
graph export "figA3-5PanelA.pdf", replace



use fertility_longrun_trends.dta, clear

twoway (connected fert year if inst1944==1, graphregion(color(gs15)) /*
*/ sort mcolor(black) msymbol(circle) lcolor(black) lwidth(medthin) lpattern(solid)) /*
*/ (connected fert year if inst1944==0, graphregion(color(gs15)) /*
*/ sort mcolor(black) msymbol(circle_hollow) lcolor(black) lwidth(medthin) lpattern(dash)), /*
*/ ytitle("Fertility Rate per 1,000 Women") ylabel(64(2)74, angle(0) grid glcolor(gs15)) /*
*/ xtitle("") xlabel(1972(2)1998, angle(45)) /*
*/ xline(1978 1988, lwidth(thin) lpattern(shortdash) lcolor(black)) /*
*/ text(73 1980 "Period of Study", place(e) box fcolor(gs15) just(center)) /* 
*/ legend(on order(1 "HWPlan1944=1" 2 "HWPlan1944=0")) 

graph export "figA3-5PanelB.pdf", replace



**************************
* Table A3.1 – Summary Statistics: 1978-1988 Airborne Lead Analysis

use ToxicTruthAirborneLeadData.dta, clear


sum lead [w=wF9BR_POPF]
sum lead if inst1944==1 [w=wF9BR_POPF]
sum lead if inst1944==0 [w=wF9BR_POPF]
sum F9BR_POPF [w=wF9BR_POPF]



foreach var in F9R_a1519 F9R_a2024 F9R_a2529 F9R_a3034 F9R_a3539 F9R_a4044{
sum `var' [w=w`var']
}

*Completed Fertility

use ipums_complete_fertility_35_44.dta, clear

sum cheborn


*Table A3.2 – Summary Statistics: 2005 Topsoil Lead Analysis
use ToxicTruthSoil.dta, clear 

sum LeadH1 lead rBIRTHS_RES [aweight=POPF]
sum LeadH1 lead rBIRTHS_RES [aweight=POPF] if LeadH1==0
sum LeadH1 lead rBIRTHS_RES [aweight=POPF] if LeadH1==1


**************************
**************************
*Appendix A4. Airborne Lead – Additional Analysis
**************************
**************************



**************************
* Figure A4.1: Event Study Surrounding the Lead Phasedown Milestones

*event study - by quarters
*DROPPING DATA  - MAY BE BETTER IN ANOTEHR FILE
use ToxicTruthAirborneLeadData.dta, clear
gen q=.
replace q=1 if month==1 | month==2 | month==3
replace q=2 if month==4 | month==5 | month==6
replace q=3 if month==7 | month==8 | month==9
replace q=4 if month==10 | month==11 | month==12

foreach var in F9BR_POPF POPF lead lnemp lnpci t t2 p p2 latitude longitude mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789{
capture drop q_`var'
by q year county_fips, sort:  egen q_`var'=mean(`var') 
}

gen qy=yq(year, q)
format qy %tq
sort qy
by q year county_fips, sort: drop if _n>1

global controls i.county_fips i.year i.qy i.state_fips##i.year q_lnemp q_lnpci q_t q_t2 q_p q_p2 i.year#c.q_latitude i.year#c.q_longitude ///
q_mean1_all_cdead1 q_mean1_all_cdead2 q_mean1_all_calive1 q_mean1_all_calive2 q_mean1_all_oneprevtermbefore20 ///
q_mean1_all_multprevtermbefore20 ///
q_mean1_all_oneprevtermafter20 ///
q_mean1_all_multprevtermafter20 ///
q_mean1_all_twin ///
q_mean1_all_cmale ///
q_mean1_cskin_all ///
q_mean1_all_meduc_ind1 ///
q_mean1_all_meduc_ind2 ///
q_mean1_all_meduc_ind3 ///
q_mean1_all_mage_ind1 ///
q_mean1_all_mage_ind2 ///
q_mean1_all_mage_ind3 ///
q_mean1_all_mage_ind4 ///
q_mean1_all_mage_ind5 ///
q_mean1_all_mage_ind6 ///
q_mean1_all_mage_ind7 ///
q_mean1_all_married ///
q_mean1_all_hosp /// 
q_mean1_all_physic /// 
q_mean1_all_prenatb12 ///
q_mean1_all_prenatb3 ///
q_mean1_all_prenatb456 ///
q_mean1_all_prenatb789 



reg q_lead i.qy##i.inst1944 $controls [aweight=q_POPF]
estimates store FA2


set scheme s2mono

coefplot ///
(FA2, keep(*.qy#1.inst1944)), vertical ciopts(recast(rcap) lcol(gs14)) msymbol(d) ///
omitted baselevels ///
coeflabels(72.qy#1.inst1944 = `" "' 73.qy#1.inst1944 = `""' 74.qy#1.inst1944 = `" "' 75.qy#1.inst1944 = `" "' ///
76.qy#1.inst1944 = `" "' 77.qy#1.inst1944 = `" "' 78.qy#1.inst1944 = `" "' 79.qy#1.inst1944 = `" "' ///
80.qy#1.inst1944 = `"1980q1"' 81.qy#1.inst1944 = `" "' 82.qy#1.inst1944 = `" "' 83.qy#1.inst1944 = `" "' ///
84.qy#1.inst1944 = `" "' 85.qy#1.inst1944 = `" "' 86.qy#1.inst1944 = `" "' 87.qy#1.inst1944 = `" "' ///
88.qy#1.inst1944 = `"1982q1"' 89.qy#1.inst1944 = `" "' 90.qy#1.inst1944 = `" "' 91.qy#1.inst1944 = `" "' ///
92.qy#1.inst1944 = `" "' 93.qy#1.inst1944 = `" "' 94.qy#1.inst1944 = `" "' 95.qy#1.inst1944 = `" "' ///
96.qy#1.inst1944 = `"1984q1"' 97.qy#1.inst1944 = `" "' 98.qy#1.inst1944 = `" "' 99.qy#1.inst1944 = `" "' ///
100.qy#1.inst1944 = `" "' 101.qy#1.inst1944 = `" "' 102.qy#1.inst1944 = `" "' 103.qy#1.inst1944 = `" "' ///
104.qy#1.inst1944 = `"1986q1"' 105.qy#1.inst1944 = `" "' 106.qy#1.inst1944 = `" "' 107.qy#1.inst1944 = `" "' ///
108.qy#1.inst1944 = `" "' 109.qy#1.inst1944 = `" "' 110.qy#1.inst1944 = `" "' 111.qy#1.inst1944 = `" "' ///
112.qy#1.inst1944 = `"1988q1"') ///
xline(8) xline(30) ///
xlabel(, angle(45)) ///
text(0.08 10.5 " Oct 1979:")  ///
text(0.05 10.5 " ≤0.8 gpg") ///
text(0.08 32.5 " Jul 1985:") ///
text(0.05 32.5 " ≤0.5 gplg") 
gr_edit .xaxis1.major.num_rule_ticks = 0
gr_edit .xaxis1.edit_tick 1 1 `" 1978q1"', tickset(major)
gr_edit .xaxis1.major.num_rule_ticks = 0
gr_edit .xaxis1.edit_tick 2 2 `""', custom tickset(major) editstyle(tickstyle(show_labels(no)) )
graph export "FigA3-1.pdf"
**************************


**************************
*Figure A4.2: Alternative Timing for the Main Outcome Variable

use ToxicTruthAirborneLeadData.dta, clear

foreach var in F7BR_POPF F8BR_POPF F9BR_POPF F10BR_POPF F11BR_POPF{
capture drop `var'lead
gen `var'lead=lead
 }

label variable F7BR_POPFlead "F7"
label variable F8BR_POPFlead "F8"
label variable F9BR_POPFlead "F9"
label variable F10BR_POPFlead "F10"
label variable F11BR_POPFlead "F11"



foreach inst in ///
 "after1inst1944 after2inst1944 AFTER1 AFTER2"{
 foreach var in F7BR_POPF F8BR_POPF F9BR_POPF F10BR_POPF F11BR_POPF{
foreach lead in "`var'lead"{
foreach fe in ///
     "i.county_fips i.year i.month i.state_fips##i.year" ///
{
	 foreach c1 in ///
		"lnemp lnpci t t2 p p2 i.year#c.latitude i.year#c.longitude mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789" ///
{
foreach weight in "[aweight=POPF]"{
 ivreg2 `var' (`lead' =`inst') `fe' `c1' ///
`weight' ,  partial(`fe') cluster(county_fips) 
estimates store `var'
}
}
} 
}
}
}

set scheme s2mono

coefplot  (F7BR_POPF, keep(F7BR_POPFlead) mcolor(black)ciopts(recast(rcap) lcolor(black))) ///
(F8BR_POPF, keep(F8BR_POPFlead) mcolor(black)ciopts(recast(rcap) lcolor(black)))  ///
(F9BR_POPF, keep(F9BR_POPFlead) mcolor(black)ciopts(recast(rcap) lcolor(black))) ///
(F10BR_POPF, keep(F10BR_POPFlead)mcolor(black)ciopts(recast(rcap) lcolor(black))) ///
(F11BR_POPF, keep(F11BR_POPFlead)mcolor(black)ciopts(recast(rcap) lcolor(black))), ///
 vertical ///
 recast(connected) ///
  msymbol(C) ///
legend(off) ///
 nooffsets ///
recast(connected) ciopts(recast(rcap)) ///
title("The Effect of Airborne Lead on GFR") ///
ytitle("Estiamed Coefficient") ///
xtitle("Time Windows")
graph export "FigA4-2.pdf"


**************************
*Table A4.1 – Airborne Lead and General Fertility Rate: Alternative Instruments


use ToxicTruthAirborneLeadData.dta, clear

local replace="replace"
foreach weight in "[aweight=POPF]"{
foreach var in F9BR_POPF{
foreach lead in lead{
foreach samp in "mmyy<=338"{ 
foreach inst in  ///
     "after1inst1944 after2inst1944 AFTER1 AFTER2" ///
	 "afterCAANASTSP after1inst1944 after2inst1944 AFTER1 AFTER2" ///
	 "my_after1gas_sales72_cb_sqm after2gas_sales72_cb_sqm AFTER1 AFTER2" ///
     "my_after1gas_stat_cb_sqm after2gas_stat_cb_sqm AFTER1 AFTER2" ///
     "my_after1gas_sales_cb_sqm after2gas_sales_cb_sqm AFTER1 AFTER2" ///
	 {
foreach fe in ///
	"i.county_fips i.year i.month i.state_fips##i.year" ///
{
foreach c1 in ///
		"lnemp lnpci t t2 p p2 i.year#c.latitude i.year#c.longitude mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789" ///
{	
ivreg2 `var' (`lead' =`inst') `fe' `c1' ///
`weight',  partial(`fe') cluster(county_fips) 
outreg2 `lead' using "TableA4-1.xls", ///
addstat("Kleibergen-Paap rk Wald F", e(widstat)) ///
se bdec(3) sdec(3) rdec(3) excel `replace'
local replace=" "
}
}
}
}
}
}
}
**************************

*Table A4.2 – Airborne Lead and Alternative Measures of Fertility: 1978-1988  
**************************

use ToxicTruthAirborneLeadData.dta, clear


local replace="replace"
foreach weight in "[aweight=POPF]"{
foreach var in F9numB_all1 log_F9numB_all1 log_F9BR_POPF{
foreach lead in lead{
foreach fe in ///
	"i.county_fips i.year i.month i.state_fips##i.year" ///
{
foreach c1 in ///
		"lnemp lnpci t t2 p p2 i.year#c.latitude i.year#c.longitude mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789" ///
{	
ivreg2 `var' `lead' `fe' `c1' ///
`weight',  partial(`fe') cluster(county_fips) 
outreg2 `lead' using "TableA4-2-OLS.xls", ///
se bdec(3) sdec(3) rdec(3) excel `replace'
local replace=" "
}
}
}
}
}



local replace="replace"
foreach weight in "[aweight=POPF]"{
foreach var in F9numB_all1 log_F9numB_all1 log_F9BR_POPF{
foreach lead in lead{
foreach inst in  ///
     "after1inst1944 after2inst1944 AFTER1 AFTER2" ///
{
foreach fe in ///
	"i.county_fips i.year i.month i.state_fips##i.year" ///
{
foreach c1 in ///
		"lnemp lnpci t t2 p p2 i.year#c.latitude i.year#c.longitude mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789" ///
{	
ivreg2 `var' (`lead' =`inst') `fe' `c1' ///
`weight',  partial(`fe') cluster(county_fips) 
outreg2 `lead' using "TableA4-2-IV.xls", ///
addstat("Kleibergen-Paap rk Wald F", e(widstat)) ///
se bdec(3) sdec(3) rdec(3) excel `replace'
local replace=" "
}
}
}
}
}
}
**************************

*Table A4.3 – Airborne Lead and General Fertility Rate: Alternative Windows of Exposure  
**************************
use ToxicTruthAirborneLeadData.dta, clear

sort county_fips mmyy

gen av_l1l2_lead=(lead+l1_lead+l2_lead)/3
gen av_l1l2l3_lead=(lead+l1_lead+l2_lead+l3_lead)/4


gen av_f1f2_lead=(lead+f1_lead+f2_lead)/3
gen av_f1f2f3_lead=(lead+f1_lead+f2_lead+f3_lead)/4



local replace="replace"
foreach weight in "[aweight=POPF]"{
foreach var in F9BR_POPF{
foreach lead in "lead" "av_l1l2_lead" "av_l1l2l3_lead" "av_f1f2_lead" "av_f1f2f3_lead"{ 
foreach inst in  ///
     "after1inst1944 after2inst1944 AFTER1 AFTER2" ///
	 {
foreach fe in ///
	"i.county_fips i.year i.month i.state_fips##i.year" ///
{
foreach c1 in ///
		"lnemp lnpci t t2 p p2 i.year#c.latitude i.year#c.longitude mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789" ///
{	
ivreg2 `var' (`lead' =`inst') `fe' `c1' ///
`weight',  partial(`fe') cluster(county_fips) 
outreg2 `lead' using "TableA4-3.xls", ///
addstat("Kleibergen-Paap rk Wald F", e(widstat)) ///
se bdec(3) sdec(3) rdec(3) excel `replace'
local replace=" "
}
}
}
}
}
}

*Table A4.4 – Airborne Lead and General Fertility Rate: 
*Eastern vs. Western U.S. and the Analysis at the Commuting Zone Level

use ToxicTruthAirborneLeadData.dta, clear

* West vs East

local replace="replace"
foreach weight in "[aweight=POPF]"{
foreach var in F9BR_POPF{
foreach lead in lead{
foreach inst in  ///
     "after1inst1944 after2inst1944 AFTER1 AFTER2" ///
{
foreach west in "1==1" "longitude>-100" "longitude<=-100"{
foreach fe in ///
	"i.county_fips i.year i.month i.state_fips##i.year" ///
{
foreach c1 in ///
		"lnemp lnpci t t2 p p2 i.year#c.latitude i.year#c.longitude mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789" ///
{	
ivreg2 `var' (`lead' =`inst') `fe' `c1' ///
if `west' `weight',  partial(`fe') cluster(county_fips) 
outreg2 `lead' using "TableA4-4-IV.xls", ///
addstat("Kleibergen-Paap rk Wald F", e(widstat)) ///
 se bdec(3) sdec(3) rdec(3) excel `replace'
local replace=" "
}
}
}
}
}
}
}

local replace="replace"
foreach weight in "[aweight=POPF]"{
foreach var in F9BR_POPF{
foreach lead in lead{
foreach west in "1==1" "longitude>-100" "longitude<=-100"{
foreach fe in ///
	"i.county_fips i.year i.month i.state_fips##i.year" ///
{
foreach c1 in ///
		"lnemp lnpci t t2 p p2 i.year#c.latitude i.year#c.longitude mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789" ///
{	
ivreg2 `var' `lead' `fe' `c1' ///
if `west' `weight',  cluster(county_fips) 
outreg2 `lead' using TableA4_4_OLS.xls, ///
se bdec(3) sdec(3) rdec(3) excel `replace'
local replace=" "
}
}
}
}
}
}


*Commuting zone

use ToxicTruthCZone.dta, clear

*OLS
local replace="replace"
foreach weight in "[aweight=POPF_czone]"{
foreach var in F9numB_czoneBR{
foreach lead in lead_czone{
foreach fe in ///
     "i.czone i.year i.month i.state_fips##i.year" ///
{
foreach c1 in ///
		"lnemp_cz lnpci_cz t_cz t2_cz p_cz p2_cz i.year#c.latitude_cz i.year#c.longitude_cz mean1_all_cdead1_cz mean1_all_cdead2_cz mean1_all_calive1_cz mean1_all_calive2_cz oneprevtermbefore20_cz multprevtermbefore20_cz oneprevtermafter20_cz multprevtermafter20_cz mean1_all_twin_cz mean1_all_cmale_cz mean1_cskin_all_cz mean1_all_meduc_ind1_cz mean1_all_meduc_ind2_cz mean1_all_meduc_ind3_cz mean1_all_mage_ind1_cz mean1_all_mage_ind2_cz mean1_all_mage_ind3_cz mean1_all_mage_ind4_cz mean1_all_mage_ind5_cz mean1_all_mage_ind6_cz mean1_all_mage_ind7_cz mean1_all_married_cz mean1_all_hosp_cz mean1_all_physic_cz mean1_all_prenatb12_cz mean1_all_prenatb3_cz mean1_all_prenatb456_cz mean1_all_prenatb789_cz" ///
{		
reg `var' `lead' `fe' `c1' ///
`weight',cluster(czone) 
outreg2 `lead' using TableA4_4_czone.xls, `replace' 
local replace=" "
}
}
}
}
}



*IV


foreach weight in "[aweight=POPF_czone]"{
foreach var in F9numB_czoneBR{
foreach lead in lead_czone{

foreach inst in ///
"inst1944 after1inst1944 after2inst1944 AFTER1 AFTER2"{
foreach fe in ///
     "i.czone i.year i.month i.state_fips##i.year" ///
{
foreach c1 in ///
		"lnemp_cz lnpci_cz t_cz t2_cz p_cz p2_cz i.year#c.latitude_cz i.year#c.longitude_cz mean1_all_cdead1_cz mean1_all_cdead2_cz mean1_all_calive1_cz mean1_all_calive2_cz oneprevtermbefore20_cz multprevtermbefore20_cz oneprevtermafter20_cz multprevtermafter20_cz mean1_all_twin_cz mean1_all_cmale_cz mean1_cskin_all_cz mean1_all_meduc_ind1_cz mean1_all_meduc_ind2_cz mean1_all_meduc_ind3_cz mean1_all_mage_ind1_cz mean1_all_mage_ind2_cz mean1_all_mage_ind3_cz mean1_all_mage_ind4_cz mean1_all_mage_ind5_cz mean1_all_mage_ind6_cz mean1_all_mage_ind7_cz mean1_all_married_cz mean1_all_hosp_cz mean1_all_physic_cz mean1_all_prenatb12_cz mean1_all_prenatb3_cz mean1_all_prenatb456_cz mean1_all_prenatb789_cz" ///
{
ivreg2 `var' (`lead' =`inst') `fe' `c1' ///
`weight',  partial(`fe') cluster(czone) 
outreg2 `lead' using TableA4_4_czone.xls, ///
addstat("Hansen_J", e(j), "Hansen_J_Pvalue", e(jp), "Underidentification_stat",e(idstat),"p_value", e(idp),"WeakIdentificationStat", e(widstat)) 
local replace=" "
}
}
}
}
}
}

********

* Table A4.5 – Airborne Lead and General Fertility Rate: One vs. Two Policy Changes

use ToxicTruthAirborneLeadData.dta, clear

*The first Stage
local replace="replace"
foreach weight in "[aweight=POPF]"{
foreach var in lead{
foreach samp in "mmyy<=305"{ 
foreach fe in ///
	"i.county_fips i.year i.month i.state_fips##i.year" ///
{
foreach c1 in ///
		"lnemp lnpci t t2 p p2 i.year#c.latitude i.year#c.longitude mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789" ///
		"lnemp lnpci t t2 p p2 mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789" ///
{	
ivreg2 `var' after1inst1944 AFTER1 `fe' `c1' ///
if `samp' `weight', cluster(county_fips) 
outreg2 after1inst1944 AFTER1 using "TA4-5-PanelA.xls", ///
ctitle("The first Stage") se bdec(3) sdec(3) rdec(3) excel `replace'
local replace=" "
}
}
}
}
}


foreach weight in "[aweight=POPF]"{
foreach var in lead{
foreach fe in ///
	"i.county_fips i.year i.month i.state_fips##i.year" ///
{
foreach c1 in ///
		"lnemp lnpci t t2 p p2 i.year#c.latitude i.year#c.longitude mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789" ///
		"lnemp lnpci t t2 p p2 mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789" ///
{	
ivreg2 `var' after1inst1944 after2inst1944 AFTER1 AFTER2 `fe' `c1' ///
`weight', cluster(county_fips) 
outreg2 after1inst1944 after2inst1944 AFTER1 AFTER2 using "TA4-5-PanelA.xls", ///
ctitle("The first Stage") se bdec(3) sdec(3) rdec(3) excel `replace'
local replace=" "
}
}
}
}



*Reduced form:
local replace="replace"
foreach weight in "[aweight=POPF]"{
foreach var in F9BR_POPF{
foreach samp in "mmyy<=305"{ 
foreach fe in ///
	"i.county_fips i.year i.month i.state_fips##i.year" ///
{
foreach c1 in ///
		"lnemp lnpci t t2 p p2 i.year#c.latitude i.year#c.longitude mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789" ///
		"lnemp lnpci t t2 p p2 mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789" ///
{	
ivreg2 `var' after1inst1944 AFTER1 `fe' `c1' ///
if `samp' `weight', cluster(county_fips) 
outreg2 after1inst1944 AFTER1 using "TA4-5-PanelB.xls", ///
ctitle("Reduced Form") se bdec(3) sdec(3) rdec(3) excel `replace'
local replace=" "
}
}
}
}
}


foreach weight in "[aweight=POPF]"{
foreach var in F9BR_POPF{
foreach fe in ///
	"i.county_fips i.year i.month i.state_fips##i.year" ///
{
foreach c1 in ///
		"lnemp lnpci t t2 p p2 i.year#c.latitude i.year#c.longitude mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789" ///
		"lnemp lnpci t t2 p p2 mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789" ///
{	
ivreg2 `var' after1inst1944 after2inst1944 AFTER1 AFTER2 `fe' `c1' ///
 `weight', cluster(county_fips) 
outreg2 after1inst1944 after2inst1944 AFTER1 AFTER2 using "TA4-5-PanelB.xls", ///
ctitle("Reduced Form") se bdec(3) sdec(3) rdec(3) excel `replace'
local replace=" "
}
}
}
}


*IV

local replace="replace"
foreach weight in "[aweight=POPF]"{
foreach var in F9BR_POPF{
foreach lead in lead{
foreach samp in "mmyy<=305"{ 
foreach inst in  ///
"after1inst1944 AFTER1" ///
{
foreach fe in ///
	"i.county_fips i.year i.month i.state_fips##i.year" ///
{
foreach c1 in ///
		"lnemp lnpci t t2 p p2 i.year#c.latitude i.year#c.longitude mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789" ///
		"lnemp lnpci t t2 p p2 mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789" ///
{	
ivreg2 `var' (`lead' =`inst') `fe' `c1' ///
if `samp' `weight',  partial(`fe') cluster(county_fips) 
outreg2 `lead' after1inst1944 AFTER1 using "TA4-5-PanelC.xls", ///
addstat("Kleibergen-Paap rk Wald F", e(widstat)) ///
ctitle("IV") se bdec(3) sdec(3) rdec(3) excel `replace'
local replace=" "
}
}
}
}
}
}
}


foreach weight in "[aweight=POPF]"{
foreach var in F9BR_POPF{
foreach lead in lead{
foreach inst in  ///
"after1inst1944 after2inst1944 AFTER1 AFTER2" ///
{
foreach fe in ///
	"i.county_fips i.year i.month i.state_fips##i.year" ///
{
foreach c1 in ///
		"lnemp lnpci t t2 p p2 i.year#c.latitude i.year#c.longitude mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789" ///
		"lnemp lnpci t t2 p p2 mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789" ///
{	
ivreg2 `var' (`lead' =`inst') `fe' `c1' ///
`weight',  partial(`fe') cluster(county_fips) 
outreg2 `lead' after1inst1944 after2inst1944 AFTER1 AFTER2 using "TA4-5-PanelC.xls", ///
addstat("Kleibergen-Paap rk Wald F", e(widstat)) ///
ctitle("IV") se bdec(3) sdec(3) rdec(3) excel `replace'
local replace=" "
}
}
}
}
}
}

*Table A4.6– State-Level Infertility Services
use TA4-6.dta, clear

reg infever i.age5 married hsch college black hispanic catholic protestant /*
*/ smoker diabetes everheardaids everheardchlamy everheardgherp menarche /*
*/ intercourse pill pregnum lbpregs miscarr stllbrth abortion workfull /*
*/ metro rural meantemp meantemp2 meantemp3 meandday30C meandday30C2 /*
*/ meandday30C3 meanprec meanprec2 meanprec3 i.region abmed_lead /*
*/ [w=W5] if stayer==1, cluster(state_fips)
outreg2 /*
*/ using TA4-6.xls, /*
*/  se bdec(4) sdec(4) rdec(4) excel replace


*Appendix A5: IV Diagnostics

*Table A5.1 – Effects of Instruments on Air Pollutants and County Characteristics
*other pollutants


use ToxicTruthAirborneLeadData.dta, clear

*1stage - other pollutants
local replace="replace"
foreach inst in ///
"after1inst1944 after2inst1944 AFTER1 AFTER2"{
foreach var in lead ozone CO SO2 NOx{
foreach fe in ///
"i.county_fips i.state_fips##i.year i.month"{
foreach c1 in ///
 "lnemp lnpci t t2 p p2 i.year#c.latitude i.year#c.longitude mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789"{
 foreach weight in "[aweight=POPF]"{
 ivreg2 `var' `inst' `fe' `c1' ///
`weight' ,  partial(`fe') cluster(county_fips) 
outreg2 `inst' using "TA5-1-PanelA.xls", ///
 se bdec(3) sdec(3) rdec(3) excel `replace'
 local replace=" "
}
} 
}
}
}


local replace="replace"
foreach inst in ///
"after1inst1944 after2inst1944 AFTER1 AFTER2"{
foreach var in mean_mage mean_meduc mean1_all_married mean1_cskin_all lnpci{
foreach fe in ///
"i.county_fips i.year i.month i.state_fips#i.year"{
foreach c1 in ///
 "i.year i.month lnemp t t2 p p2 i.year#c.latitude i.year#c.longitude mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789"{
 foreach weight in "[aweight=POPF]"{
 reg `var' `inst' `fe' `c1' ///
 `weight' ,  cluster(county_fips) 
outreg2 `inst' using "TA5-1-PanelB.xls", ///
se bdec(3) sdec(3) rdec(3) excel `replace'
 local replace=" "

}
} 
}
}
}


*Table A5.2 -  Balance of Covariates by Counties With and Without Planned Highways
*sum table


use ToxicTruthAirborneLeadData.dta, clear


estpost tabstat ///
mean1_all_cmale mean1_cskin_all ///
mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789 ///
mean1_all_hosp  mean1_all_physic ///
mean1_all_twin ///
mean1_all_married ///
mean_mage ///
mean_meduc ///
lnemp ///
lnpci ///
t ///
p, ///
by(inst1944) statistics(mean sd) columns(statistics) listwise
esttab using "TA5-2.txt", replace ///
main(mean) aux(sd) nostar unstack noobs nonote nomtitle nonumber


*Table A5.3 – Hausman Test - Airborne Lead

use ToxicTruthAirborneLeadData.dta, clear


local replace="replace"
foreach weight in "[aweight=POPF]"{
foreach var in F9BR_POPF{
foreach lead in lead{
foreach samp in "mmyy<=338"{ 
foreach inst in  ///
"after1inst1944 after2inst1944 AFTER1 AFTER2" ///
{
foreach fe in ///
     "i.county_fips i.year i.month i.state_fips##i.year" ///
{
foreach c1 in ///
		"lnemp lnpci t t2 p p2 i.year#c.latitude i.year#c.longitude mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789" ///
{	
ivreg2 `var' (`lead' =`inst') `fe' `c1' ///
`weight',  partial(`fe') cluster(county_fips) endog(lead)
}
}
}
}
}
}
}


*Hausman Test - Soil Lead

use ToxicTruthSoil.dta, clear

ivreg2 rBIRTHS_RES ///
(LeadH1=inst1944) ///
demvotepres2008 nonattANY phousbuilt1939e phousbuilt194049 phousbuilt195059 phousbuilt196069 phousbuilt197079 phousbuilt198089 phousbuilt199099 phousbuilt200004 phousbuilt2005p housbuittotal medhousroom200509 emp1000		pci1000		pctrsfr1000		emp10002		pci10002		pctrsfr10002		unemprate2007		percbelpovrate2007 swhite2007 percforeign200509 s25yrshsch200509 s25yrscoll200509 sage5 sage59 sage1014 sage1519 sage2024 sage2529 sage3034 sage3539 sage4044 sage4549 sage5054 sage5559 sage6064 yprcp ytav mydda29 myddb10 i.STATEFIP latitude longitude ///
[aweight= POPF], partial(i.STATEFIP) cluster(STATEFIP) endog(LeadH1)




*Table A5.4 – Bounds for the Main IV Estimates

**************************

use ToxicTruthAirborneLeadData.dta, clear

foreach bounds in ///
"gmin(-0.4 -0.4 -0.4 -0.4 -0.4) gmax(0 0 0 0 0)" ///
"gmin(-0.3 -0.3 -0.3 -0.3 -0.3) gmax(0 0 0 0 0)" ///
"gmin(-0.2 -0.2 -0.2 -0.2 -0.2) gmax(0 0 0 0 0)" ///
"gmin(-0.1 -0.1 -0.1 -0.1 -0.1) gmax(0 0 0 0 0)" ///
{
foreach weight in "[aweight=POPF]"{
foreach var in F9BR_POPF{
foreach lead in lead{
foreach samp in "mmyy<=338"{ 
foreach inst in  ///
"inst1944 my_after1inst1944 after2inst1944 my_after1 AFTER2" ///
{
foreach fe in ///
     "i.county_fips i.year i.month i.state_fips##i.year" ///
{
foreach c1 in ///
		"lnemp lnpci t t2 p p2 i.year#c.latitude i.year#c.longitude mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1 mean1_all_calive2 mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_meduc_ind3 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_mage_ind7 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789" ///
{	
plausexog uci `var'  `fe' `c1'  (`lead' =`inst') ///
if c==1 & sample==1 & sample1==1 & `samp' `weight', `bounds' partial(`fe') cluster(county_fips)
di  "`bounds'" 
}
}
}
}
}
}
}
}


tab year, gen(yearN)
tab county_fips, gen(county_fipsN)
tab month, gen(monthN)
tab state_fips, gen(state_fipsN)

forvalues i=1(1)47{
gen stmmN`i'=state_fipsN`i'*mmyy
}

forvalues i=1(1)11{
gen yearlatN`i'=yearN`i'*latitude
}


forvalues i=1(1)11{
gen yearlonN`i'=yearN`i'*longitude
}

egen sy=group(state_fips year)
tab sy, gen (syN)


imperfectiv F9BR_POPF county_fipsN2-county_fipsN337 monthN2-monthN12 ///
syN2-syN474 ///
lnemp lnpci t t2 p p2 ///
yearlonN2-yearlonN11 ///
yearlatN2-yearlatN11 ///
mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1  mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789 ///
(lead = after1inst1944 after2inst1944 AFTER1 AFTER2)  ///
[aweight=POPF], ncorr vce(cluster county_fips)



imperfectiv F9BR_POPF county_fipsN2-county_fipsN337 monthN2-monthN12 ///
syN2-syN474 ///
lnemp lnpci t t2 p p2 ///
yearlonN2-yearlonN11 ///
yearlatN2-yearlatN11 ///
mean1_all_cdead1 mean1_all_cdead2 mean1_all_calive1  mean1_all_oneprevtermbefore20 mean1_all_multprevtermbefore20 mean1_all_oneprevtermafter20 mean1_all_multprevtermafter20 mean1_all_twin mean1_all_cmale mean1_cskin_all mean1_all_meduc_ind1 mean1_all_meduc_ind2 mean1_all_mage_ind1 mean1_all_mage_ind2 mean1_all_mage_ind3 mean1_all_mage_ind4 mean1_all_mage_ind5 mean1_all_mage_ind6 mean1_all_married mean1_all_hosp mean1_all_physic mean1_all_prenatb12 mean1_all_prenatb3 mean1_all_prenatb456 mean1_all_prenatb789 ///
(lead = after1inst1944 after2inst1944 AFTER1 AFTER2)  ///
[aweight=POPF], vce(cluster county_fips)




*Table A5.1  - Topsoil Analysis:  Alternative Topsoil Lead Measures


use ToxicTruthSoil.dta, clear

*First Stage
local replace="replace"
foreach dep in LeadH1 lead llead{
foreach w in "[aweight= POPF]"{
foreach c1 in ///
"demvotepres2008 nonattANY phousbuilt1939e phousbuilt194049 phousbuilt195059 phousbuilt196069 phousbuilt197079 phousbuilt198089 phousbuilt199099 phousbuilt200004 phousbuilt2005p housbuittotal medhousroom200509 emp1000		pci1000		pctrsfr1000		emp10002		pci10002		pctrsfr10002		unemprate2007		percbelpovrate2007 swhite2007 percforeign200509 s25yrshsch200509 s25yrscoll200509 sage5 sage59 sage1014 sage1519 sage2024 sage2529 sage3034 sage3539 sage4044 sage4549 sage5054 sage5559 sage6064 yprcp ytav mydda29 myddb10 i.STATEFIP latitude longitude"{
reg `dep' inst1944 `c1' `w',  cluster(STATEFIP)
outreg2 inst1944  using "TA5-1-PanelA.xls", se bdec(3) rdec(3) ///
ctitle("Panel A. 1st Stage") excel `replace' 
local replace=" "

}
}
}

*OLS
local replace="replace"
foreach dep in rBIRTHS_RES{
foreach lead in LeadH1 lead llead{
foreach w in "[aweight= POPF]"{
foreach c1 in ///
"demvotepres2008 nonattANY phousbuilt1939e phousbuilt194049 phousbuilt195059 phousbuilt196069 phousbuilt197079 phousbuilt198089 phousbuilt199099 phousbuilt200004 phousbuilt2005p housbuittotal medhousroom200509 emp1000		pci1000		pctrsfr1000		emp10002		pci10002		pctrsfr10002		unemprate2007		percbelpovrate2007 swhite2007 percforeign200509 s25yrshsch200509 s25yrscoll200509 sage5 sage59 sage1014 sage1519 sage2024 sage2529 sage3034 sage3539 sage4044 sage4549 sage5054 sage5559 sage6064 yprcp ytav mydda29 myddb10 i.STATEFIP latitude longitude"{
reg `dep' `lead' `c1' `w', cluster(STATEFIP)
outreg2 `lead' using "TA5-1-PanelB.xls", se bdec(3) rdec(3) ///
ctitle("Panel B. OLS") excel `replace' 
local replace=" "

}
}
}
}

*IV
local replace="replace"
foreach dep in rBIRTHS_RES{
foreach w in "[aweight= POPF]"{
foreach lead in LeadH1 lead llead{
foreach c1 in ///
"demvotepres2008 nonattANY phousbuilt1939e phousbuilt194049 phousbuilt195059 phousbuilt196069 phousbuilt197079 phousbuilt198089 phousbuilt199099 phousbuilt200004 phousbuilt2005p housbuittotal medhousroom200509 emp1000		pci1000		pctrsfr1000		emp10002		pci10002		pctrsfr10002		unemprate2007		percbelpovrate2007 swhite2007 percforeign200509 s25yrshsch200509 s25yrscoll200509 sage5 sage59 sage1014 sage1519 sage2024 sage2529 sage3034 sage3539 sage4044 sage4549 sage5054 sage5559 sage6064 yprcp ytav mydda29 myddb10 i.STATEFIP latitude longitude"{
ivreg2 `dep' (`lead'=inst1944) `c1' `w', partial(`c1') cluster(STATEFIP)
outreg2 `lead' using "TA5-1-PanelC.xls", se bdec(3) rdec(3) ///
addstat("Kleibergen-Paap rk Wald F", e(widstat)) ///
 ctitle("Panel C. IV") excel `replace' 
local replace=" "

}
}
}
}



*Table A5.2 - Topsoil Analysis: IV Estimates for Alternative Specifications

use ToxicTruthSoil.dta, clear


*1st Stage
foreach dep in rBIRTHS_RES{
foreach w in "[aweight= POPF]"{
foreach lead in LeadH1 {
foreach c1 in ///
"demvotepres2008 nonattANY phousbuilt1939e phousbuilt194049 phousbuilt195059 phousbuilt196069 phousbuilt197079 phousbuilt198089 phousbuilt199099 phousbuilt200004 phousbuilt2005p housbuittotal medhousroom200509 emp1000		pci1000		pctrsfr1000		emp10002		pci10002		pctrsfr10002		unemprate2007		percbelpovrate2007 swhite2007 percforeign200509 s25yrshsch200509 s25yrscoll200509 sage5 sage59 sage1014 sage1519 sage2024 sage2529 sage3034 sage3539 sage4044 sage4549 sage5054 sage5559 sage6064 yprcp ytav mydda29 myddb10 i.STATEFIP latitude longitude"{
foreach indep in "(`lead'  = inst1944) "{ 
ivreg2 `dep' `indep' `c1' `w', partial(`c1') cluster(STATEFIP) savefirst
est restore _ivreg2_`lead'
outreg2 using "TA5-2.xls", se bdec(3) rdec(3) ///
ctitle("1_Stage", "LeadH1", "1") excel replace
}
}
}
}
}
*1st Stage
local replace="replace"
foreach dep in rBIRTHS_RES{
foreach w in "[aweight= POPF]"{
foreach lead in LeadH1 {
foreach c1 in ///
"demvotepres2008 nonattANY phousbuilt1939e phousbuilt194049 phousbuilt195059 phousbuilt196069 phousbuilt197079 phousbuilt198089 phousbuilt199099 phousbuilt200004 phousbuilt2005p housbuittotal medhousroom200509 emp1000		pci1000		pctrsfr1000		emp10002		pci10002		pctrsfr10002		unemprate2007		percbelpovrate2007 swhite2007 percforeign200509 s25yrshsch200509 s25yrscoll200509 sage5 sage59 sage1014 sage1519 sage2024 sage2529 sage3034 sage3539 sage4044 sage4549 sage5054 sage5559 sage6064 yprcp ytav mydda29 myddb10 i.STATEFIP latitude longitude"{
foreach indep in "(`lead' avgcommutime2000 = inst1944 cap) "{ 
ivreg2 `dep' `indep' `c1' `w', partial(`c1') cluster(STATEFIP) savefirst
est restore _ivreg2_`lead'
outreg2 using "TA5-2.xls", se bdec(3) rdec(3) ///
ctitle("1_Stage", "LeadH1", "2") excel append

est restore _ivreg2_avgcommutime2000
outreg2 using "TA5-2.xls", se bdec(3) rdec(3) ///
ctitle("1_Stage", "avgcommutime2000", "2") excel append

}
}
}
}
}


*1st Stage
local replace="replace"
foreach dep in rBIRTHS_RES{
foreach w in "[aweight= POPF]"{
foreach lead in LeadH1 {
foreach c1 in ///
"demvotepres2008 nonattANY phousbuilt1939e phousbuilt194049 phousbuilt195059 phousbuilt196069 phousbuilt197079 phousbuilt198089 phousbuilt199099 phousbuilt200004 phousbuilt2005p housbuittotal medhousroom200509 emp1000		pci1000		pctrsfr1000		emp10002		pci10002		pctrsfr10002		unemprate2007		percbelpovrate2007 swhite2007 percforeign200509 s25yrshsch200509 s25yrscoll200509 sage5 sage59 sage1014 sage1519 sage2024 sage2529 sage3034 sage3539 sage4044 sage4549 sage5054 sage5559 sage6064 yprcp ytav mydda29 myddb10 i.STATEFIP latitude longitude"{
foreach indep in "(`lead' avgcommutime2000 physp100th2004 = inst1944 cap hbtot)"{ 
ivreg2 `dep' `indep' `c1' `w', partial(`c1') cluster(STATEFIP) savefirst
est restore _ivreg2_`lead'
outreg2 using "TA5-2.xls", se bdec(3) rdec(3) ///
ctitle("1_Stage", "LeadH1", "3") excel append

est restore _ivreg2_avgcommutime2000
outreg2 using "TA5-2.xls", se bdec(3) rdec(3) ///
ctitle("1_Stage", "avgcommutime2000", "3") excel append

est restore _ivreg2_physp100th2004
outreg2 using "TA5-2.xls", se bdec(3) rdec(3) ///
ctitle("1_Stage", "physp100th2004", "3") excel append

}
}
}
}
}


*IV
local replace="replace"
foreach dep in rBIRTHS_RES{
foreach w in "[aweight= POPF]"{
foreach lead in LeadH1 {
foreach c1 in ///
"demvotepres2008 nonattANY phousbuilt1939e phousbuilt194049 phousbuilt195059 phousbuilt196069 phousbuilt197079 phousbuilt198089 phousbuilt199099 phousbuilt200004 phousbuilt2005p housbuittotal medhousroom200509 emp1000		pci1000		pctrsfr1000		emp10002		pci10002		pctrsfr10002		unemprate2007		percbelpovrate2007 swhite2007 percforeign200509 s25yrshsch200509 s25yrscoll200509 sage5 sage59 sage1014 sage1519 sage2024 sage2529 sage3034 sage3539 sage4044 sage4549 sage5054 sage5559 sage6064 yprcp ytav mydda29 myddb10 i.STATEFIP latitude longitude"{
foreach indep in "(`lead'  = inst1944) " "(`lead' avgcommutime2000 = inst1944 cap) "  "(`lead' avgcommutime2000 physp100th2004 = inst1944 cap hbtot)"{ 
ivreg2 `dep' `indep' `c1' `w', partial(`c1') cluster(STATEFIP) savefirst
outreg2 `lead' avgcommutime2000 physp100th2004 using "TA5-2_IV.xls", se bdec(3) rdec(3) ///
addstat("Underidentification_stat",e(idstat),"p_value", e(idp),"WeakIdentificationStat", e(widstat)) /// 
ctitle(`dep', `w', "IV") excel `replace' 
local replace=" "
}
}
}
}
}




**************************
